
namespace Needle.Bus.Engine.Stages
{
    public class BatchModeOptions
    {

        public BatchModeOptions()
            : this(false, 0, 0)
        { }

        /// <summary>
        /// Initializes a new instance of the StageOptions class.
        /// </summary>
        /// <param name="enabled">true if the stage uses batch processing, 
        /// false if the stage processes messages one at a time</param>
        /// <param name="minBatchSize">minimum batch size, ignored if enabled is false</param>
        /// <param name="maxBatchSize">maximum batch size, ignored if enabled is false</param>
        public BatchModeOptions(bool enabled, int minBatchSize, int maxBatchSize)
        {
            _enabled = enabled;
            if (enabled)
            {
                _minBatchSize = minBatchSize;
                _maxBatchSize = maxBatchSize;
            }
            else
            {
                _minBatchSize = 0;
                _maxBatchSize = 0;
            }
        }

        private readonly bool _enabled;
        public bool Enabled
        {
            get { return _enabled; }
        }
        private readonly int _minBatchSize;
        public int MinBatchSize
        {
            get { return _minBatchSize; }
        }
        private readonly int _maxBatchSize;
        public int MaxBatchSize
        {
            get { return _maxBatchSize; }
        }

    }
}
